const filecache = require("../middleware/filecache");
const auth = require("../middleware/auth");
module.exports = (app) => {
  const {
    controller,
    router,
    config: { api },
  } = app;
  const authMiddleware = auth(app);
  router.get(
    `${api.v1}user/userinfo`,
    authMiddleware,
    controller.user.getUserInfo
  );
  router.post(`${api.v1}user/login`, controller.user.login);
  router.post(`${api.v1}user/logout`, controller.user.logout);
  router.post(`${api.v1}user/register`, controller.user.register);
  router.post(`${api.v1}user/check`, controller.user.check);
  router.put(`${api.v1}user/thirdauth`, controller.user.thirdAuth);
  router.put(`${api.v1}user/third_auth_bind`, controller.user.thirdAuthBind);
  router.put(`${api.v1}user/third_unbind`, controller.user.thirdUnbind);
  router.get(`${api.v1}user/userset`, controller.user.getUserSet);
  router.put(`${api.v1}user/userset`, controller.user.putUserSet);
  router.get(`${api.v1}user/vipinfo`, authMiddleware, controller.user.userVipInfo);
  router.all(`${api.v1}push`, controller.index.push);
  router.all(`${api.prefix}apple_auth`, controller.user.appleAuth);
  router.post(
    `${api.prefix}apple_auth_callback`,
    controller.user.appleAuthCallback
  );
  router.post(`${api.v1}user_update`, controller.user.update);
};
